package io.gitee.hchaojie.day08.thread.exam2;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

public class Main {
    public static void main(String[] args) {
        Factory factory = new Factory();

        Producer producer = new Producer(factory);
        Consumer consumer = new Consumer(factory);
        Consumer consumer2 = new Consumer(factory);

        ExecutorService service = Executors.newFixedThreadPool(10);

        service.submit(producer);
        service.submit(consumer);
        service.submit(consumer2);
    }
}
